﻿CREATE PROCEDURE [dbo].[Employee_Insert]

@CreatedBy uniqueidentifier
, @ModifiedBy uniqueidentifier
, @DesignationID uniqueidentifier
, @DivisionID uniqueidentifier
, @PersonID	uniqueidentifier
, @EmployeeNumber varchar (24)
AS
BEGIN
SET NOCOUNT ON

DECLARE @CreatedDate datetime
DECLARE @ModifiedDate datetime
DECLARE @Deleted bit
DECLARE @EmployeeID uniqueidentifier
SET @CreatedDate = GETDATE()
SET @ModifiedDate = GETDATE()
SET @Deleted = 0
SET @EmployeeID = NEWID()

INSERT INTO [dbo].[Employee] ([EmployeeID]
, [CreatedDate]
, [CreatedBy]
, [ModifiedDate]
, [ModifiedBy]
, [Deleted]
, [DesignationID]
, [DivisionID]
, [PersonID]
, [EmployeeNumber]
)
VALUES (@EmployeeID
, @CreatedDate
, @CreatedBy
, @ModifiedDate
, @ModifiedBy
, @Deleted
, @DesignationID
, @DivisionID
, @PersonID
, @EmployeeNumber
)

SELECT @EmployeeID [EmployeeID]
END
